package com.qfedu.lc.server.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 2.用户日志表
 * </p>
 *
 * @author wgz
 * @since 2023-10-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class UserLog implements Serializable {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private Integer userId;

    private String type;

    private String ip;

    private String info;

    private String mobile;

    /**
     * 添加时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") //响应 1.当处理器方法返回对象时，将java.utils.Date 转化为对应的字符串 2023-08-31
    //接收   2.如果前端提交的json字符串 使用java对象接收    字符串2023-08-31 转化为java.utils.Date类型
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") // 将前端提交的键值对的时间字符串2023-08-31 转化为java.utils.Date类型
    private Date ctime;

    public UserLog() {
    }

    public UserLog(Integer userId, String type, String ip, String info, String mobile, Date ctime) {
        this.userId = userId;
        this.type = type;
        this.ip = ip;
        this.info = info;
        this.mobile = mobile;
        this.ctime = ctime;
    }
}
